<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/misc.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">misc.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d0/d0e/misc_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#ifndef __MISC_H__</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#define __MISC_H__</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#include &quot;<a class="code" href="../../d8/d68/fs_8hpp.html">fs.hpp</a>&quot;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#if ENABLE_BACKTRACE == 1</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#   include &quot;<a class="code" href="../../da/dfe/backtrace_8hpp.html">backtrace.hpp</a>&quot;</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="comment">/*</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="comment"> * 终端输出颜色定义。方便输出错误或者录数据的分辨。 </span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="comment"> */</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#if !defined(USE_GUI)</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#afa7a41e86b5a1e570713a9b9bae068f0">   33</a></span><span class="preprocessor">#   define TRED          &quot;\033[31m&quot;</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a7a18f09d3bb5a5f03a55546e38f8efd8">   34</a></span><span class="preprocessor">#   define ERR_MSG       TRED</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a70a9e4e4cfc9146e8009c8812c600c27">   35</a></span><span class="preprocessor">#   define TGREEN        &quot;\033[32m&quot;</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a3334b4c7a06d103e2758af5421a6a1c5">   36</a></span><span class="preprocessor">#   define OK_MSG        TGREEN</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#aec0e1d2d6520a88d62913bbdbd8e84d4">   37</a></span><span class="preprocessor">#   define TBLUE         &quot;\033[34m&quot;</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a7af93a5ebfd8ccac4fec0d7f65b5f5cd">   38</a></span><span class="preprocessor">#   define TYELLOW       &quot;\033[33m&quot;</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a0f92dc8e39d938f21d077a42098bdedf">   39</a></span><span class="preprocessor">#   define WARNING_MSG   TYELLOW</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ac0d4a58b35d49450ad09b7d84319a624">   40</a></span><span class="preprocessor">#   define TNORMAL       &quot;\033[0m&quot;</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="preprocessor">#   define TRED          &quot;&quot;</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="preprocessor">#   define ERR_MSG       TRED</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="preprocessor">#   define TGREEN        &quot;&quot;</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="preprocessor">#   define OK_MSG        TGREEN</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="preprocessor">#   define TBLUE         &quot;&quot;</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="preprocessor">#   define TYELLOW       &quot;&quot;</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span><span class="preprocessor">#   define WARNING_MSG   TYELLOW</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span><span class="preprocessor">#   define TNORMAL       &quot;&quot;</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span><span class="preprocessor">#if defined(__cplusplus)</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span>{</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span><span class="keyword">extern</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="../../d0/d0e/misc_8hpp.html#a2094690597548488e18bb486e2f72263">G_LOG_BUF</a>[ ];</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span><span class="preprocessor">#if defined(__cplusplus)</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>}</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a86d500a34c624c2cae56bc25a31b12f3">   59</a></span><span class="preprocessor">#define UNUSED( x )   (void )x</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>std::string <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a94febd15cfa38c4e0f3e8b90aaec5dc3">nowStr</a>();</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span> </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span><span class="comment">// 再LOG输出的时候如果需要输出源代码的信息，将SHOW_FILE_INFO配置为1</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span><span class="preprocessor">#if (SHOW_FILE_INFO == 1)</span></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span><span class="preprocessor">#   define __FILE_name__ __FILE__</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span><span class="preprocessor">#       define __LINE_no__ __LINE__</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span><span class="preprocessor">#   define LEFT_BRACE &quot; [ &quot;</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span><span class="preprocessor">#   define RIGHT_BRACE &quot; ] &quot;</span></div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ab647704ca8edc0b779a8621c06c1d273">   72</a></span><span class="preprocessor">#   define __FILE_name__ &quot;&quot;</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#adb1345a8509082faf29cbe52100958b3">   73</a></span><span class="preprocessor">#       define __LINE_no__ &quot;&quot;</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a1ab25f0f8631cb1f49b0d75e7f9b8863">   74</a></span><span class="preprocessor">#   define LEFT_BRACE &quot;&quot;</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a0e876cdc2cc84e6dfeafde01db4d8a3d">   75</a></span><span class="preprocessor">#   define RIGHT_BRACE &quot;&quot;</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span><span class="preprocessor">#if defined( __DEBUG__ )</span></div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>    <span class="keywordtype">void</span> dump( <span class="keyword">const</span> <span class="keywordtype">char</span>* data , <span class="keywordtype">size_t</span> s );</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    <span class="keywordtype">void</span> dump_2( <span class="keyword">const</span> <span class="keywordtype">char</span>* data , <span class="keywordtype">size_t</span> s );</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span> </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span><span class="preprocessor">     #define __show_line( str ) do{ \</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span><span class="preprocessor">        std::cerr &lt;&lt;  nowStr() &lt;&lt; &quot; &quot; &lt;&lt; LEFT_BRACE &lt;&lt; __LINE_no__ &lt;&lt; RIGHT_BRACE &lt;&lt; __FILE_name__  &lt;&lt; &quot; &quot; &lt;&lt; TRED &lt;&lt; str &lt;&lt; TNORMAL &lt;&lt; std::endl;\</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span><span class="preprocessor">    }while(0)</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span><span class="preprocessor">    #define __show_line_1( format , ... ) do{               \</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span><span class="preprocessor">          std::cerr &lt;&lt; nowStr() &lt;&lt;  &quot; &quot;                     \</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span><span class="preprocessor">            &lt;&lt; LEFT_BRACE                                   \</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span><span class="preprocessor">            &lt;&lt; __LINE_no__                                  \</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span><span class="preprocessor">            &lt;&lt; RIGHT_BRACE                                  \</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span><span class="preprocessor">            &lt;&lt; __FILE_name__ &lt;&lt; &quot; &quot;                         \</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span><span class="preprocessor">            &lt;&lt; TRED ;                                       \</span></div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span><span class="preprocessor">        sprintf( G_LOG_BUF , format , __VA_ARGS__ );        \</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span><span class="preprocessor">        std::cerr &lt;&lt; G_LOG_BUF &lt;&lt; TNORMAL &lt;&lt; std::endl;     \</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span><span class="preprocessor">        G_LOG_BUF[ 0 ] = 0;                                 \</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span><span class="preprocessor">         }while(0)</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="preprocessor">    #define __show_line_2() __show_line(&quot;&quot;)</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span> </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span><span class="preprocessor">    #define MSG( str , color ) do{                      \</span></div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span><span class="preprocessor">           std::cout&lt;&lt;  nowStr() &lt;&lt;  &quot; &quot;                \</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span><span class="preprocessor">            &lt;&lt; LEFT_BRACE                               \</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span><span class="preprocessor">            &lt;&lt; __LINE_no__ &lt;&lt; RIGHT_BRACE               \</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span><span class="preprocessor">            &lt;&lt; __FILE_name__ &lt;&lt; &quot; &quot;                     \</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span><span class="preprocessor">            &lt;&lt; color  &lt;&lt; str &lt;&lt; TNORMAL &lt;&lt; std::endl;   \</span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span><span class="preprocessor">    }while( 0 )</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span> </div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span><span class="preprocessor">    #define MSG_1( format ,color, ... ) do{                     \</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span><span class="preprocessor">        std::cout &lt;&lt;  nowStr() &lt;&lt;  &quot; &quot;                          \</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span><span class="preprocessor">              &lt;&lt; LEFT_BRACE                                     \</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span><span class="preprocessor">              &lt;&lt; __LINE_no__                                    \</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span><span class="preprocessor">              &lt;&lt; RIGHT_BRACE                                    \</span></div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span><span class="preprocessor">              &lt;&lt; __FILE_name__&lt;&lt;&quot; &quot;                             \</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span><span class="preprocessor">              &lt;&lt; color;                                         \</span></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span><span class="preprocessor">        sprintf( G_LOG_BUF , format , __VA_ARGS__ );            \</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span><span class="preprocessor">        std::cout &lt;&lt; G_LOG_BUF &lt;&lt; TNORMAL &lt;&lt; std::endl;         \</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span><span class="preprocessor">        G_LOG_BUF[ 0 ] = 0;                                     \</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span><span class="preprocessor">    }while(0)</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span><span class="preprocessor">        #define MSG_2() MSG(&quot;&quot;)</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a11faaf23c26bedd3f630a4ed62fc0db1">  122</a></span><span class="preprocessor">    #define __show_line( str )</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a94252fbb098a3a13b05497928ee7bbd0">  123</a></span><span class="preprocessor">    #define __show_line_1( format , ... )</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a935295cf972b20015da66df600700833">  124</a></span><span class="preprocessor">    #define __show_line_2()</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a5e96928e16ca9022cb7002cde20a71da">  126</a></span><span class="preprocessor">        #define MSG( str , color )</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a47497e4d892bd8be1db0117d6cf456a6">  127</a></span><span class="preprocessor">        #define MSG_1( format , coor , ... )</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a921f5e81135829921f06534e1df323a8">  128</a></span><span class="preprocessor">        #define MSG_2()</span></div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span><span class="preprocessor">#ifndef ERROR</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a39b3cc118c8339855e5578335a0b2417">  131</a></span><span class="preprocessor">#define ERROR( str ) __show_line( str )</span></div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span><span class="preprocessor">#if ENABLE_BACKTRACE == 1</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span><span class="preprocessor">#   define BACKTRACE()  do{                                     \</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span><span class="preprocessor">    wheels::backtrace * p_dump = wheels::backtrace::get();  \</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span><span class="preprocessor">        if( p_dump ){                                           \</span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span><span class="preprocessor">            p_dump-&gt;dump();                                     \</span></div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span><span class="preprocessor">    }                                                       \</span></div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span><span class="preprocessor">    }while(0)</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a20264f7063bbb7af3a73b58075f07d0c">  141</a></span><span class="preprocessor">#   define BACKTRACE() do{}while(0)</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span> </div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ab66bafe0e3773f589f4a239eb3aaecff">  144</a></span><span class="preprocessor">#define ERROR_MSG( str ) __show_line( str )</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span> </div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ad276adf60b6ce23b45da05a6df14c3cb">  146</a></span><span class="preprocessor">#define WARN_MSG( str ) MSG( str , TYELLOW )</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span> </div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span><span class="preprocessor">#if defined( WIN32 ) || defined( _WIN32 ) || defined( WINNT )</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>    <span class="keyword">static</span> <span class="keyword">const</span> std::string PATH_DILMTER(<span class="stringliteral">&quot;\\&quot;</span>);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span><span class="preprocessor">#elif defined( __LINUX__ )</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>    <span class="keyword">static</span> <span class="keyword">const</span> std::string PATH_DILMTER(<span class="stringliteral">&quot;/&quot;</span>);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a8d7b1a8651ec4b1742bdf9bd044fc4d2">log_base</a>( <span class="keywordtype">bool</span> enable , std::ostream&amp; os, <span class="keyword">const</span> std::string&amp; msg );</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span><span class="preprocessor">#if !defined( LOG )</span></div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a53211bf6f837a243f9cdd097bd68f463">  161</a></span><span class="preprocessor">#define LOG( enable , msg )     log_base( enable , std::cerr , msg )</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a92938bf426566e58f2c0eb0eca83c7e3">logln_base</a>( <span class="keywordtype">bool</span> , std::ostream&amp; , <span class="keyword">const</span> std::string&amp; );</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a9b6806226cd2d301b0f7edd50825780f">  167</a></span><span class="preprocessor">#define LOGLN( enable , msg )   logln_base( enable , std::cerr , msg )</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">  169</a></span><span class="keyword">typedef</span> uint64_t <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a>;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a7e44195ffbad9da273e65efb7ed69975">  170</a></span><span class="keyword">constexpr</span> <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a> <a class="code hl_variable" href="../../d0/d0e/misc_8hpp.html#a7e44195ffbad9da273e65efb7ed69975">__basis</a> = 0xCBF29CE484222325ull;</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a4f54077a0fc6bbefd339a1621aedf256">  171</a></span><span class="keyword">constexpr</span> <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a> <a class="code hl_variable" href="../../d0/d0e/misc_8hpp.html#a4f54077a0fc6bbefd339a1621aedf256">__prime</a> = 0x100000001B3ull;</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span><span class="keyword">extern</span> <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ac7d1e0a91bfa612dce72b060d9e15119">hash_</a>( <span class="keywordtype">char</span> <span class="keyword">const</span> *str );</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span><span class="keyword">extern</span> <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ac7d1e0a91bfa612dce72b060d9e15119">hash_</a>( <span class="keywordtype">char</span> <span class="keyword">const</span> *str , <span class="keywordtype">size_t</span> len );</div>
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a6d1f4bc2d820a40633066a2b177be8f0">  175</a></span><span class="keyword">constexpr</span> <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a6d1f4bc2d820a40633066a2b177be8f0">hash_compile_time</a>(<span class="keywordtype">char</span> <span class="keyword">const</span>* str, <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a> last_value = <a class="code hl_variable" href="../../d0/d0e/misc_8hpp.html#a7e44195ffbad9da273e65efb7ed69975">__basis</a>)</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>{</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>    <span class="keywordflow">return</span> *str ? <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a6d1f4bc2d820a40633066a2b177be8f0">hash_compile_time</a>(str+1, (*str ^ last_value) * <a class="code hl_variable" href="../../d0/d0e/misc_8hpp.html#a4f54077a0fc6bbefd339a1621aedf256">__prime</a>) : last_value;</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>}</div>
</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span> </div>
<div class="foldopen" id="foldopen00180" data-start="{" data-end="}">
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a63f67c35d2dc8d92a9ea6da0eee9eaa0">  180</a></span><span class="keyword">constexpr</span> <a class="code hl_typedef" href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a> <span class="keyword">operator</span><span class="stringliteral">&quot;&quot;</span> _hash( <span class="keyword">const</span> <span class="keywordtype">char</span> * data , <span class="keywordtype">size_t</span> )</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>{</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a6d1f4bc2d820a40633066a2b177be8f0">hash_compile_time</a>( data );</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>}</div>
</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span> </div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span><span class="comment">// 编译期计算字符串长度，并包装为 &lt;字符串&gt;,&lt;长度&gt;</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ad1d4376cb392143209ab5048310f2742">  186</a></span><span class="keyword">constexpr</span> <span class="keywordtype">size_t</span> <span class="keyword">operator</span><span class="stringliteral">&quot;&quot;</span> _c_strLen( <span class="keyword">const</span> <span class="keywordtype">char</span> * , <span class="keywordtype">size_t</span> N ){ <span class="keywordflow">return</span> N;}</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ad5eefdab78e9f53d4615b50d8f9b057c">  187</a></span><span class="preprocessor">#define C_STR_LEN( str )  str , &quot;str&quot;_c_strLen</span></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span> </div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a57a708e347fb48a1bd1b9dc31c00bd15">  197</a></span><span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a57a708e347fb48a1bd1b9dc31c00bd15">gbk2utf8</a>( <span class="keyword">const</span> <span class="keywordtype">char</span> * from , <span class="keywordtype">size_t</span> len , <span class="keywordtype">char</span> ** rst , <span class="keywordtype">size_t</span> &amp; rlen );</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a39313e865510655edf68b11cbf7b7b6f">  206</a></span><span class="keyword">extern</span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a39313e865510655edf68b11cbf7b7b6f">utf2gbk</a>( <span class="keyword">const</span> std::string&amp; msg , <span class="keywordtype">char</span> ** data );</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span> </div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a60fd19bc6b440bebc49e3a72cec3de0c">reverseByte</a>(<span class="keywordtype">void</span>* data, <span class="keywordtype">size_t</span> len);</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#aa0ff437d0b446235c74667f8bb5fceac">  220</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#aa0ff437d0b446235c74667f8bb5fceac">ps</a>( <span class="keyword">const</span> std::string&amp; pattern , std::function&lt; <span class="keywordtype">void</span> ( std::vector&lt;std::string&gt;&amp;&amp; ) &gt; fun );</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span><span class="preprocessor">#if defined( __WIN32 ) || defined( __WIN64 ) || defined( WINNT )</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span>  std::string <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#abb335c27232d047e28e7123f58fadb76">localIP</a>( <span class="keywordtype">bool</span> ipv4 );</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span><span class="preprocessor">#   if !defined( access )</span></div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span><span class="preprocessor"># define access( a , b ) _access( a , b )</span></div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span><span class="preprocessor"># define F_OK   0</span></div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span><span class="preprocessor">#   endif</span></div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#abb335c27232d047e28e7123f58fadb76">  234</a></span>std::string <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#abb335c27232d047e28e7123f58fadb76">localIP</a>( <span class="keyword">const</span> std::string&amp; eth );</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#aa55d507cca1bd486b35f16db6e683c1f">isIPv4</a>(<span class="keyword">const</span> std::string&amp; ipstr);</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ac79a4e05918d249ac1b0ea6c1c4d20d5">isIPv6</a>(<span class="keyword">const</span> std::string&amp; ipstr);</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>time_t <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ac8a8a7ed4acfadc5c30d7950fc7e8260">parseGMT</a>( <span class="keyword">const</span> std::string&amp; gmt , <span class="keywordtype">int</span> loc = 8);</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span> </div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a1281e08e5da281269eef64e5790c4116">fileNameFromPath</a>( <span class="keyword">const</span> std::string&amp; path , std::string&amp; name );</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span> </div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span><span class="keywordtype">size_t</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ab148021dd478aa69c83029819b268737">getFileSize</a>( <span class="keyword">const</span> std::string&amp; path );</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ad87e6be76e73d5a94404e82ccfcd082b">  277</a></span>std::string <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ad87e6be76e73d5a94404e82ccfcd082b">getLocalIP</a>( <span class="keywordtype">bool</span> ipv4 = <span class="keyword">true</span> );</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a23cfcaab6b6df224338877527e1f49dc">split</a>( <span class="keyword">const</span> std::string&amp; str , <span class="keywordtype">char</span> c , std::vector&lt; std::string &gt;&amp; rst );</div>
<div class="foldopen" id="foldopen00291" data-start="{" data-end="}">
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#adc75a513912f0c4d40d5882955b411c1">  291</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#adc75a513912f0c4d40d5882955b411c1">isDir</a>( <span class="keyword">const</span> std::string&amp; dir )</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno">  292</span>{</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#a821cb3cdae648caf6a9f92b39c864421">fs::isDir</a>( dir );</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span>}</div>
</div>
<div class="foldopen" id="foldopen00300" data-start="{" data-end="}">
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a7d89edea2694a572f10f019e2b0731c5">  300</a></span><span class="keyword">inline</span> std::string <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a7d89edea2694a572f10f019e2b0731c5">fileName</a>( <span class="keyword">const</span> std::string&amp; path )</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno">  301</span>{</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span>    <span class="keywordflow">if</span>( path.empty() ) <span class="keywordflow">return</span> {};</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno">  303</span>    <span class="keywordflow">if</span>( <a class="code hl_function" href="../../dc/d2f/classfs.html#a821cb3cdae648caf6a9f92b39c864421">fs::isDir</a>( path ) ) <span class="keywordflow">return</span> {};</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno">  304</span> </div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno">  305</span>    <span class="keyword">auto</span> pos = path.rfind( PATH_DILMTER );</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno">  306</span>    <span class="keywordflow">if</span>( pos == std::string::npos ) <span class="keywordflow">return</span> path;</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno">  307</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno">  308</span>    std::string ret = path.substr( pos + 1);</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno">  309</span>    <span class="keywordflow">return</span> ret;</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span>}</div>
</div>
<div class="foldopen" id="foldopen00316" data-start="{" data-end="}">
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#aa6ab57aaa484b0046c82e74c5c30e050">  316</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#aa6ab57aaa484b0046c82e74c5c30e050">dirEmpty</a>( <span class="keyword">const</span> std::string&amp; dir )</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno">  317</span>{</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#acddf6fbd688a9f3ab94f8634090ac9db">fs::dirEmpty</a>( dir );</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span>}</div>
</div>
<div class="foldopen" id="foldopen00327" data-start="{" data-end="}">
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a82532c7da66cb6f199552ed698d23c48">  327</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a82532c7da66cb6f199552ed698d23c48">removeFile</a>( <span class="keyword">const</span> std::string&amp; path , <span class="keyword">const</span> std::string&amp; pattern , <span class="keywordtype">bool</span> re )</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno">  328</span>{</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno">  329</span>    <span class="keyword">auto</span> rst = <a class="code hl_function" href="../../dc/d2f/classfs.html#aadd2e9ee5179b644dac3206cdd662f34">fs::removeFile</a>( path , pattern , re );</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno">  330</span>    <span class="keywordflow">if</span>( rst == <a class="code hl_enumvalue" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a38fb7051ea8a8af6304601faeacf66a7">fs::OK</a> ) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno">  331</span> </div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span>    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno">  333</span>}</div>
</div>
<div class="foldopen" id="foldopen00339" data-start="{" data-end="}">
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a91bf6ce30f0a6e35897002a612542d66">  339</a></span><span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a91bf6ce30f0a6e35897002a612542d66">clearDir</a>( <span class="keyword">const</span> std::string&amp; path )</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno">  340</span>{</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno">  341</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a82532c7da66cb6f199552ed698d23c48">removeFile</a>( path , <span class="stringliteral">&quot;.+&quot;</span> , <span class="keyword">true</span> );</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno">  342</span>}</div>
</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ad605102266bc9a7e031f96829c2025c2">  347</a></span><span class="keyword">extern</span> std::string <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ad605102266bc9a7e031f96829c2025c2">cpuID</a>();</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno">  348</span> </div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#a61e82baec4cd1113d77b65371f3b8c3b">  354</a></span><span class="keyword">extern</span> std::string <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#a61e82baec4cd1113d77b65371f3b8c3b">ExeCmd</a>(std::string pszCmd);</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno">  355</span> </div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#ac19d75ec7032d98bde0b289f395bf9af">  356</a></span><span class="keyword">extern</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#ac19d75ec7032d98bde0b289f395bf9af">ExecCmd</a>(std::string pszCmd , <span class="keywordtype">bool</span> detachParent = <span class="keyword">false</span> );</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"><a class="line" href="../../d0/d0e/misc_8hpp.html#aaa7cd844529d35582ff924713a697184">  363</a></span><span class="keyword">extern</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d0/d0e/misc_8hpp.html#aaa7cd844529d35582ff924713a697184">execCmd</a>(std::string pszCmd , std::function&lt; <span class="keywordtype">void</span> ( <span class="keyword">const</span> std::string&amp; )&gt; fun);</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno">  364</span> </div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno">  365</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno">  366</span> </div>
<div class="ttc" id="abacktrace_8hpp_html"><div class="ttname"><a href="../../da/dfe/backtrace_8hpp.html">backtrace.hpp</a></div></div>
<div class="ttc" id="aclassfs_html_a821cb3cdae648caf6a9f92b39c864421"><div class="ttname"><a href="../../dc/d2f/classfs.html#a821cb3cdae648caf6a9f92b39c864421">fs::isDir</a></div><div class="ttdeci">static bool isDir(const std::string &amp;path)</div><div class="ttdoc">判断给定的路径是否是目录</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00075">fs.cpp:75</a></div></div>
<div class="ttc" id="aclassfs_html_aadd2e9ee5179b644dac3206cdd662f34"><div class="ttname"><a href="../../dc/d2f/classfs.html#aadd2e9ee5179b644dac3206cdd662f34">fs::removeFile</a></div><div class="ttdeci">static emErrCode removeFile(const std::string &amp;path, const std::string &amp;reg, bool re=true)</div><div class="ttdoc">删除满足条件要求的文件或者目录</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00206">fs.cpp:206</a></div></div>
<div class="ttc" id="aclassfs_html_acddf6fbd688a9f3ab94f8634090ac9db"><div class="ttname"><a href="../../dc/d2f/classfs.html#acddf6fbd688a9f3ab94f8634090ac9db">fs::dirEmpty</a></div><div class="ttdeci">static bool dirEmpty(const std::string &amp;path)</div><div class="ttdoc">判断指定目录是否是空目录</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00018">fs.cpp:18</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49a38fb7051ea8a8af6304601faeacf66a7"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a38fb7051ea8a8af6304601faeacf66a7">fs::OK</a></div><div class="ttdeci">@ OK</div><div class="ttdef"><b>定义</b> <a href="../../d8/d68/fs_8hpp_source.html#l00057">fs.hpp:56</a></div></div>
<div class="ttc" id="afs_8hpp_html"><div class="ttname"><a href="../../d8/d68/fs_8hpp.html">fs.hpp</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a1281e08e5da281269eef64e5790c4116"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a1281e08e5da281269eef64e5790c4116">fileNameFromPath</a></div><div class="ttdeci">bool fileNameFromPath(const std::string &amp;path, std::string &amp;name)</div><div class="ttdoc">从路径中抽出文件名称。 1 函数会检查本地文件是否存在，如果不存在根据最后路径是否还存在 分隔符號，如果不存在分隔符號则直接给出最后一个名称。如果存在判断为目录 2 如果文件存在，则会检查对象是否是目录</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00526">misc.cpp:526</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a2094690597548488e18bb486e2f72263"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a2094690597548488e18bb486e2f72263">G_LOG_BUF</a></div><div class="ttdeci">char G_LOG_BUF[]</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00046">misc.cpp:46</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a23cfcaab6b6df224338877527e1f49dc"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a23cfcaab6b6df224338877527e1f49dc">split</a></div><div class="ttdeci">int split(const std::string &amp;str, char c, std::vector&lt; std::string &gt; &amp;rst)</div><div class="ttdoc">将字符串按照指定的标记分割成多个字符串</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00730">misc.cpp:730</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a39313e865510655edf68b11cbf7b7b6f"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a39313e865510655edf68b11cbf7b7b6f">utf2gbk</a></div><div class="ttdeci">size_t utf2gbk(const std::string &amp;msg, char **data)</div><div class="ttdoc">UTF8编码转换成GBK编码</div></div>
<div class="ttc" id="amisc_8hpp_html_a4f54077a0fc6bbefd339a1621aedf256"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a4f54077a0fc6bbefd339a1621aedf256">__prime</a></div><div class="ttdeci">constexpr hash_t __prime</div><div class="ttdef"><b>定义</b> <a href="#l00171">misc.hpp:171</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a57a708e347fb48a1bd1b9dc31c00bd15"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a57a708e347fb48a1bd1b9dc31c00bd15">gbk2utf8</a></div><div class="ttdeci">int gbk2utf8(const char *from, size_t len, char **rst, size_t &amp;rlen)</div><div class="ttdoc">GBK编码转换成UTF8编码</div></div>
<div class="ttc" id="amisc_8hpp_html_a60fd19bc6b440bebc49e3a72cec3de0c"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a60fd19bc6b440bebc49e3a72cec3de0c">reverseByte</a></div><div class="ttdeci">bool reverseByte(void *data, size_t len)</div><div class="ttdoc">将数据按照字节方式改变大小端。长度必须是偶数的，否则返回错误</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00416">misc.cpp:416</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a61e82baec4cd1113d77b65371f3b8c3b"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a61e82baec4cd1113d77b65371f3b8c3b">ExeCmd</a></div><div class="ttdeci">std::string ExeCmd(std::string pszCmd)</div><div class="ttdoc">执行外部程序，返回程序执行的标准输出结果</div></div>
<div class="ttc" id="amisc_8hpp_html_a6d1f4bc2d820a40633066a2b177be8f0"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a6d1f4bc2d820a40633066a2b177be8f0">hash_compile_time</a></div><div class="ttdeci">constexpr hash_t hash_compile_time(char const *str, hash_t last_value=__basis)</div><div class="ttdef"><b>定义</b> <a href="#l00175">misc.hpp:175</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a7d89edea2694a572f10f019e2b0731c5"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a7d89edea2694a572f10f019e2b0731c5">fileName</a></div><div class="ttdeci">std::string fileName(const std::string &amp;path)</div><div class="ttdoc">从路径中抽取文件名。</div><div class="ttdef"><b>定义</b> <a href="#l00300">misc.hpp:300</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a7e44195ffbad9da273e65efb7ed69975"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a7e44195ffbad9da273e65efb7ed69975">__basis</a></div><div class="ttdeci">constexpr hash_t __basis</div><div class="ttdef"><b>定义</b> <a href="#l00170">misc.hpp:170</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a82532c7da66cb6f199552ed698d23c48"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a82532c7da66cb6f199552ed698d23c48">removeFile</a></div><div class="ttdeci">bool removeFile(const std::string &amp;path, const std::string &amp;pattern, bool re)</div><div class="ttdoc">removeFile</div><div class="ttdef"><b>定义</b> <a href="#l00327">misc.hpp:327</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a8d7b1a8651ec4b1742bdf9bd044fc4d2"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a8d7b1a8651ec4b1742bdf9bd044fc4d2">log_base</a></div><div class="ttdeci">void log_base(bool enable, std::ostream &amp;os, const std::string &amp;msg)</div><div class="ttdoc">输出信息到指定的流</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00077">misc.cpp:77</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a91bf6ce30f0a6e35897002a612542d66"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a91bf6ce30f0a6e35897002a612542d66">clearDir</a></div><div class="ttdeci">bool clearDir(const std::string &amp;path)</div><div class="ttdoc">删除当前目录下的所有内容</div><div class="ttdef"><b>定义</b> <a href="#l00339">misc.hpp:339</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a92938bf426566e58f2c0eb0eca83c7e3"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a92938bf426566e58f2c0eb0eca83c7e3">logln_base</a></div><div class="ttdeci">void logln_base(bool, std::ostream &amp;, const std::string &amp;)</div><div class="ttdoc">按照行输出信息，也就是完成输出消息后再自动添加一个换行</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00084">misc.cpp:84</a></div></div>
<div class="ttc" id="amisc_8hpp_html_a94febd15cfa38c4e0f3e8b90aaec5dc3"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#a94febd15cfa38c4e0f3e8b90aaec5dc3">nowStr</a></div><div class="ttdeci">std::string nowStr()</div><div class="ttdoc">当前时间的字符串</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00392">misc.cpp:392</a></div></div>
<div class="ttc" id="amisc_8hpp_html_aa0ff437d0b446235c74667f8bb5fceac"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#aa0ff437d0b446235c74667f8bb5fceac">ps</a></div><div class="ttdeci">void ps(const std::string &amp;pattern, std::function&lt; void(std::vector&lt; std::string &gt; &amp;&amp;) &gt; fun)</div><div class="ttdoc">查看进程列表</div></div>
<div class="ttc" id="amisc_8hpp_html_aa55d507cca1bd486b35f16db6e683c1f"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#aa55d507cca1bd486b35f16db6e683c1f">isIPv4</a></div><div class="ttdeci">bool isIPv4(const std::string &amp;ipstr)</div><div class="ttdoc">判断是否是IPv4字符串</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00435">misc.cpp:435</a></div></div>
<div class="ttc" id="amisc_8hpp_html_aa6ab57aaa484b0046c82e74c5c30e050"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#aa6ab57aaa484b0046c82e74c5c30e050">dirEmpty</a></div><div class="ttdeci">bool dirEmpty(const std::string &amp;dir)</div><div class="ttdoc">判断目录是否为空</div><div class="ttdef"><b>定义</b> <a href="#l00316">misc.hpp:316</a></div></div>
<div class="ttc" id="amisc_8hpp_html_aaa7cd844529d35582ff924713a697184"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#aaa7cd844529d35582ff924713a697184">execCmd</a></div><div class="ttdeci">bool execCmd(std::string pszCmd, std::function&lt; void(const std::string &amp;)&gt; fun)</div><div class="ttdoc">异步执行外部程序，通过回调函数获取程序输出的标准流数据</div></div>
<div class="ttc" id="amisc_8hpp_html_ab148021dd478aa69c83029819b268737"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#ab148021dd478aa69c83029819b268737">getFileSize</a></div><div class="ttdeci">size_t getFileSize(const std::string &amp;path)</div><div class="ttdoc">获取文件大小</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00558">misc.cpp:558</a></div></div>
<div class="ttc" id="amisc_8hpp_html_abb335c27232d047e28e7123f58fadb76"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#abb335c27232d047e28e7123f58fadb76">localIP</a></div><div class="ttdeci">std::string localIP(const std::string &amp;eth)</div><div class="ttdoc">查询指定网卡IP地址</div></div>
<div class="ttc" id="amisc_8hpp_html_ac19d75ec7032d98bde0b289f395bf9af"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#ac19d75ec7032d98bde0b289f395bf9af">ExecCmd</a></div><div class="ttdeci">bool ExecCmd(std::string pszCmd, bool detachParent=false)</div></div>
<div class="ttc" id="amisc_8hpp_html_ac79a4e05918d249ac1b0ea6c1c4d20d5"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#ac79a4e05918d249ac1b0ea6c1c4d20d5">isIPv6</a></div><div class="ttdeci">bool isIPv6(const std::string &amp;ipstr)</div><div class="ttdoc">判断是否是IPv6字符串</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00446">misc.cpp:446</a></div></div>
<div class="ttc" id="amisc_8hpp_html_ac7d1e0a91bfa612dce72b060d9e15119"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#ac7d1e0a91bfa612dce72b060d9e15119">hash_</a></div><div class="ttdeci">hash_t hash_(char const *str)</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00051">misc.cpp:51</a></div></div>
<div class="ttc" id="amisc_8hpp_html_ac8a8a7ed4acfadc5c30d7950fc7e8260"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#ac8a8a7ed4acfadc5c30d7950fc7e8260">parseGMT</a></div><div class="ttdeci">time_t parseGMT(const std::string &amp;gmt, int loc=8)</div><div class="ttdoc">解析GMT时间字符串</div><div class="ttdef"><b>定义</b> <a href="../../d7/d5f/misc_8cpp_source.html#l00457">misc.cpp:457</a></div></div>
<div class="ttc" id="amisc_8hpp_html_ad605102266bc9a7e031f96829c2025c2"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#ad605102266bc9a7e031f96829c2025c2">cpuID</a></div><div class="ttdeci">std::string cpuID()</div><div class="ttdoc">读取CPU ID</div></div>
<div class="ttc" id="amisc_8hpp_html_ad87e6be76e73d5a94404e82ccfcd082b"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#ad87e6be76e73d5a94404e82ccfcd082b">getLocalIP</a></div><div class="ttdeci">std::string getLocalIP(bool ipv4=true)</div><div class="ttdoc">获取本机的IP地址</div></div>
<div class="ttc" id="amisc_8hpp_html_adc75a513912f0c4d40d5882955b411c1"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#adc75a513912f0c4d40d5882955b411c1">isDir</a></div><div class="ttdeci">bool isDir(const std::string &amp;dir)</div><div class="ttdoc">判断是否是目录</div><div class="ttdef"><b>定义</b> <a href="#l00291">misc.hpp:291</a></div></div>
<div class="ttc" id="amisc_8hpp_html_afc91d3cceff94258bb6566969046caa5"><div class="ttname"><a href="../../d0/d0e/misc_8hpp.html#afc91d3cceff94258bb6566969046caa5">hash_t</a></div><div class="ttdeci">uint64_t hash_t</div><div class="ttdef"><b>定义</b> <a href="#l00169">misc.hpp:169</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
